Route
public class Route
Method Summary | |
---|---|
static void | pattern(string|array name, string rule) 注册变量规则 |
static void | domain(string|array domain, mixed rule, array option, array pattern) 注册子域名部署规则 |
static mixed | bind(mixed bind, string type) 设置路由绑定 |
static array | name(string|array name, array value) 设置或者获取路由标识 |
static mixed | getBind(string type) 读取路由绑定 |
static void | import(array rule, string type) 导入配置文件的路由规则 |
protected static void | registerRules(mixed rules, str type) |
static void | rule(string rule, string route, string type, array option, array pattern) 注册路由规则 |
protected static void | setRule(string rule, string route, string type, array option, array pattern, string group) 设置路由规则 |
static mixed | getGroup(string type) 获取当前的分组信息 |
static void | setGroup(string name, array option, array pattern) 设置当前的路由分组 |
static void | group(string|array name, array|\Closure routes, array option, array pattern) 注册路由分组 |
static void | any(string rule, string route, array option, array pattern) 注册路由 |
static void | get(string rule, string route, array option, array pattern) 注册GET路由 |
static void | post(string rule, string route, array option, array pattern) 注册POST路由 |
static void | put(string rule, string route, array option, array pattern) 注册PUT路由 |
static void | delete(string rule, string route, array option, array pattern) 注册DELETE路由 |
static void | patch(string rule, string route, array option, array pattern) 注册PATCH路由 |
static void | resource(string rule, string route, array option, array pattern) 注册资源路由 |
static void | controller(string rule, string route, array option, array pattern) 注册控制器路由 操作方法对应不同的请求后缀 |
static void | alias(string|array rule, string route, array option) 注册别名路由 |
static void | setMethodPrefix(string method, string prefix) 设置不同请求类型下面的方法前缀 |
static void | rest(string name, array resourece, mixed resource) rest方法定义和修改 |
static void | miss(string route, string method, array option) 注册未匹配路由规则后的处理 |
static void | auto(string route) 注册一个自动解析的URL路由 |
static array | rules(mixed rules) 获取或者批量设置路由定义 |
static void | checkDomain(Request request, array currentRules, string method) 检测子域名部署 |
static false|array | check(Request request, string url, string depr, bool checkDomain) 检测URL路由 |
static array | bindToClass(string url, string class, string depr) 绑定到类 |
static array | bindToNamespace(string url, string namespace, string depr) 绑定到命名空间 |
static array | bindToController(string url, string controller, string depr) 绑定到控制器类 |
static array | bindToModule(string url, string class, string depr, mixed controller) 绑定到模块/控制器 |
static array | parseUrl(string url, string depr, bool autoSearch) 解析模块的URL地址 [模块/控制器/操作?]参数1=值1&参数2=值2... |
public static void pattern(string|array name, string rule)
注册变量规则
public static void domain(string|array domain, mixed rule, array option, array pattern)
注册子域名部署规则
public static mixed bind(mixed bind, string type)
设置路由绑定
public static array name(string|array name, array value)
设置或者获取路由标识
public static mixed getBind(string type)
读取路由绑定
public static void import(array rule, string type)
导入配置文件的路由规则
protected static void registerRules(mixed rules, str type)
public static void rule(string rule, string route, string type, array option, array pattern)
注册路由规则
protected static void setRule(string rule, string route, string type, array option, array pattern, string group)
设置路由规则
public static mixed getGroup(string type)
获取当前的分组信息
public static void setGroup(string name, array option, array pattern)
设置当前的路由分组
public static void group(string|array name, array|\Closure routes, array option, array pattern)
注册路由分组
public static void any(string rule, string route, array option, array pattern)
注册路由
public static void get(string rule, string route, array option, array pattern)
注册GET路由
public static void post(string rule, string route, array option, array pattern)
注册POST路由
public static void put(string rule, string route, array option, array pattern)
注册PUT路由
public static void delete(string rule, string route, array option, array pattern)
注册DELETE路由
public static void patch(string rule, string route, array option, array pattern)
注册PATCH路由
public static void resource(string rule, string route, array option, array pattern)
注册资源路由
public static void controller(string rule, string route, array option, array pattern)
注册控制器路由 操作方法对应不同的请求后缀
public static void alias(string|array rule, string route, array option)
注册别名路由
public static void setMethodPrefix(string method, string prefix)
设置不同请求类型下面的方法前缀
public static void rest(string name, array resourece, mixed resource)
rest方法定义和修改
public static void miss(string route, string method, array option)
注册未匹配路由规则后的处理
public static void auto(string route)
注册一个自动解析的URL路由
public static array rules(mixed rules)
获取或者批量设置路由定义
public static void checkDomain(Request request, array currentRules, string method)
检测子域名部署
public static false|array check(Request request, string url, string depr, bool checkDomain)
检测URL路由
public static array bindToClass(string url, string class, string depr)
绑定到类
public static array bindToNamespace(string url, string namespace, string depr)
绑定到命名空间
public static array bindToController(string url, string controller, string depr)
绑定到控制器类
public static array bindToModule(string url, string class, string depr, mixed controller)
绑定到模块/控制器
public static array parseUrl(string url, string depr, bool autoSearch)
解析模块的URL地址 [模块/控制器/操作?]参数1=值1&参数2=值2...